import axios from 'axios'
export const ax = axios.create({ // axios.create创建返回一个新的axios函数对象
  baseURL: 'http://liufusong.top:8080'
})
// 导出自定义函数, 参数对象解构赋值
export default ({ url, method = 'GET', params, data, headers }) => {
  return ax({
    url: url,
    method: method,
    params: params,
    data: data,
    headers: headers
  })
}
